//
//  UIView + Extension.swift
//  MyWeiBo
//
//  Created by fangzhengwei on 2017/3/26.
//  Copyright © 2017年 fangzhengwei. All rights reserved.
//

import UIKit

extension UIView {
    
    var x : CGFloat {
        
        get {
          
            return self.frame.origin.x
            
        } set {
            
            self.frame.origin.x = newValue
        }
    }
    var y : CGFloat {
        
        get {
            
            return self.frame.origin.y
            
        } set {
            
            self.frame.origin.y = newValue
        }
    }

    var width : CGFloat {
        
        get {
            
            return self.bounds.size.width
            
        } set {
            
           self.bounds.size.width = newValue
        }
    }

    var height : CGFloat {
        
        get {
            
            return self.bounds.size.height
            
        } set {
            
            self.bounds.size.height = newValue
        }
    }
    
    var centerX : CGFloat {
        
        get {
            
            return self.center.x
            
        } set {
            
            self.center.x = newValue
        }
    }

    var centerY : CGFloat {
        
        get {
            
            return self.center.y
            
        } set {
            
            self.center.y = newValue
        }
    }
}










